package com.framework.loippi.controller.api;

import com.framework.loippi.api.utils.ApiUtils;
import com.framework.loippi.entity.Details;
import com.framework.loippi.service.DetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller("apiMedicineDetailController")
@Api(tags = "药品详情信息")
@RequestMapping("/api/detail")
public class MedicineDetailController extends ApiBaseController {

    @Resource
    DetailsService detailsService;

    @RequestMapping(value = "/findById.json", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @ApiOperation(value = "根据id查询药品详情", notes = "{}")
    public @ResponseBody
    String findById(Long id) {

        Details details = detailsService.find(id);

        return ApiUtils.success(details);
    }
}
